home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: nntp.coast.net!torn!nott!emr1!jagrant
- From: jagrant@emr1.emr.ca (John Grant)
- Subject: Re: Unbuffered character input...
- Message-ID: <DM2zCI.379@emr1.emr.ca>
- Organization: Energy, Mines, and Resources, Ottawa
- References: <Pine.SGI.3.91.960129190205.27936A-100000@tahiti.cs.unm.edu> <4elf0t$5vd@ixnews2.ix.netcom.com> <4ep3a1$bee@hacgate2.hac.com>
- Date: Thu, 1 Feb 1996 05:02:41 GMT
-
- In article <4ep3a1$bee@hacgate2.hac.com> collins@thor.tu.hac.com (Ron Collins) writes:
- >Kevin Landry (kevgar@ix.netcom.com) wrote:
- >: Caleb Haley <chaley@tahiti.cs.unm.edu> wrote:
- >
- >: >Greetings!
- >
- >: >Just curious--is there a way to do unbuffered character input in c?
- >: >i.e. getting just one character without waiting for a carriage return
- >: >(enter)...
- >
- >: I believe there are two commands in C that do this. getch() is
- >: unbuffered input without echo and getche() has the echo. Hope this
- >: helps.
- >
- >: -kevgar@ix.netcom.com
- >: "Cry havoc, and let slip
- >: the dogs of war!!"
- >
- >No, these are not standard C functions. (What is a "command"?) These
- >functions are only available on DOS compilers as non-standard extensions.
- >
- >There is no portable way to get unbuffered input, since C can't possibly
- >know all about the dozens or hundreds of different terminal types available
- >on all the machines made around the world.
- >
- >For best results (i.e., least evil alternative), check out the "curses"
- >library available for your machine. Most common flavors can be had for
- >free from any SimTel mirror.
- Does 'portability' or 'least evil' imply that everything that is
- not ANSI C be routed through a local version of a UNIX library?
- --
- John A. Grant jagrant@emr1.emr.ca
- Airborne Geophysics
- Geological Survey of Canada, Ottawa
-